home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_13_1986_Transactor_Publishing.d64 / b-128 irq rate (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  4KB  |  82 lines

  1. 100 rem save"0:b128 irq rate",8:   rem   elizabeth deal   malvern pa  (v2)
  2. 101 ;
  3. 102 v1 went to the transactor. v3 (this) better timer-b code, and
  4. 110 ;          irq mask is better
  5. 120 interrupts on the b-machines are handled by the tri-port chip at
  6. 130 $de00. it appears that any valid cia2 source, in addition to the
  7. 140 tod-alarm, can be used to interrupt.
  8. 150 ;
  9. 160 normally irqs occur at the power line frequency (bit 0 at $de02). they
  10. 170 can be turned off and replaced by another source, for instance, timer-a
  11. 180 falling through zero, as on the c64. it's a pest, but can be done.
  12. 230 ;
  13. 250 you can type the bytes under the ******** (NULL) the monitor.
  14. 260 (NULL) 15:sys 7*256 gets it (NULL)ing. the little reset button kills the project.
  15. 262 :
  16. 264 one use might be u.k. software which relies on the 50/sec irqs. you may
  17. 265 try it with superscript, start the code (NULL) the sys call above (not
  18. 267 monitor!), then load and run superscript as you normally do. my (NULL)board
  19. 268 does not bounce the (NULL)s anymore and always types correct characters.
  20. 269 :
  21. 270 ;     ********
  22. 800 f0700 78          sei
  23. 801 f0701 ad 07 de    lda $de07 ;clear latch & air
  24. 802 f0704 8d 07 de    sta $de07
  25. 803 f0707 a9 40       lda #$40  ;set timer a for 50hz ($9c40)
  26. 804 f0709 8d 04 dc    sta $dc04 ;(60hz=$8235)
  27. 805 f070c a9 9c       lda #$9c
  28. 806 f070e 8d 05 dc    sta $dc05
  29. 807 f0711 a9 81       lda #$81  ;icr-enable ta irqs only
  30. 808 f0713 8d 0d dc    sta $dc0d
  31. 809 f0716 ad 0e dc    lda $dc0e ;cra-leave 50/60hz flag alone for tod
  32. 810 f0719 29 80       and #$80  ;start ta in continuous mode
  33. 811 f071b 09 01       ora #$01
  34. 812 f071d 8d 0e dc    sta $dc0e
  35. 813 f0720 ad 05 de    lda $de05 ;tri-port irq mask ...
  36. 814 f0723 29 fe       and #$fe  ;  ignore power line flips
  37. 815 f0725 09 04       ora #$04  ;  enable cia2 irqs instead
  38. 816 f0727 8d 05 de    sta $de05
  39. 817 f072a a9 36       lda #$36  ;switch irq routine to (*)
  40. 818 f072c 8d 00 03    sta $0300
  41. 819 f072f a9 07       lda #$07
  42. 820 f0731 8d 01 03    sta $0301
  43. 821 f0734 58          cli
  44. 823 f0735 60          rts
  45. 824 f0736 a5 01   (*) lda $01   ;irq patch
  46. 825 f0738 48          pha
  47. 826 f0739 ae 07 de    ldx $de07 ;look at irq flag
  48. 827 f073c 8a          txa
  49. 828 f073d 29 04       and #$04  ;was it cia2"?
  50. 829 f073f d0 04       bne $0745 ;yes, [203] around
  51. 830 f0741 8a          txa       ;  no...
  52. 831 f0742 4c f5 fb    jmp $fbf5 ;  ...do usual stuff
  53. 832 f0745 ea          nop       ;yes [171] try 'inc $d043' here
  54. 833 f0746 ea          nop
  55. 834 f0747 ea          nop
  56. 835 f0748 ad 0d dc    lda $dc0d ;[161][173]clear cia2[171]irq flag
  57. 836 f074b 29 02       [175] #$02  ;is ieee[171]timeout bit set"?
  58. 837 f074d f0 10       beq $075f ;  nope, (NULL) around
  59. 838 f074f a9 00       lda #$00  ;  yup, force it on
  60. 839 f0751 8d 06 dc    sta $dc06 ;  so that disk routines can see
  61. 840 f0754 8d 07 dc    sta $dc07 ;  this bit.
  62. 841 f0457 ad 0f dc    lda $dc0f ;  set timer-b for one shot mode
  63. 842 f045a 09 18       ora #$18  ;  so it won't time out all the time
  64. 843 f045c 8d 0f dc    sta $dc0f ;  but disk will still see it once
  65. 844 f045f 4c 81 fc    jmp $fc81 ;do (NULL)board scan, etc... rti
  66. 845 ;
  67. 900 some additions to the transactor v4#5 issue
  68. 901 for protecto/cbm b-128 version
  69. 905 ;
  70. 910 $de02:   irq latch. poke zero to clear 1 bit, read $de07 to clr all
  71. 920 ;         7     6     8     4     3     2     1     0
  72. 930 ;        not   not   irq   acia  cia1  cia2  ieee  60hz
  73. 940 ;        used  used  pend        ip          srq   pwr
  74. 945 ;
  75. 946 $de06:   cb is unconnected (both bits are high)
  76. 947 ;
  77. 950 $dc0d:   bit 1, timer b (cont.mode) is set for ieee 65ms
  78. 960 ;        timeouts. bit 1 is tested only, no irqs.
  79. 965 ;
  80. 970 $dc0e:   cia2 cra. bit 7 is zero (1 in u.k.) tod will use 60hz.
  81. 980 ;        bit 3 is set at ioinit time - ta one shot and never used.
  82.